<extend name="Public/base"/>

<block name="style">
	<link rel="stylesheet" href="__STATIC__/plugins/data-tables/DT_bootstrap.css" />
</block>

<block name="body">

	<!-- 数据列表 -->
    
    <div class="row">
        <div class="col-md-12">
            <!-- BEGIN EXAMPLE TABLE PORTLET-->
            <div class="portlet box green">
                <div class="portlet-title">
                    <div class="caption">
                    	<i class="fa fa-globe"></i>
                        行为列表
                    </div>
                    <div class="tools">
                        <a href="javascript:;" class="collapse"></a>
                        <a href="#portlet-config" data-toggle="modal" class="config"></a>
                        <a href="javascript:;" class="reload"></a>
                    </div>
                </div>
                <div class="portlet-body">
                    <div class="table-toolbar">
                        <div class="btn-group">
                                                
                            <a class="btn green" id="action_add" href="{:U('user/addaction')}">新 增</a>
                            <button class="btn green ajax-post" target-form="ids" url="{:u('setStatus',array('status'=>1,'Model'=>'action'))}" >启 用</button>
                            <button class="btn green ajax-post" target-form="ids" url="{:u('setStatus',array('status'=>0,'Model'=>'action'))}">禁 用</button>
                            <button class="btn green ajax-post confirm" target-form="ids" url="{:U('setStatus',array('status'=>-1,'Model'=>'action'))}">删 除</button>
                        </div>
                    </div>
                    <table class="table table-striped table-bordered table-hover" id="sample">
                        <thead>
                            <tr>
                                <th class="table-checkbox"><input type="checkbox" class="group-checkable" data-set="#sample .checkboxes" /></th>
                                <th>编号</th>
                                <th>标识</th>
                                <th>名称</th>
                                <th>类型</th>
                                <th>规则</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <volist name="_list" id="vo">
                            <tr class="odd gradeX">
                                <td><input class="checkboxes ids" type="checkbox" name="ids[]" value="{$vo.id}" /></td>
                                <td>{$vo.id} </td>
                                <td>{$vo.name}</td>
                                <td><a href="{:U('editAction?id='.$vo['id'])}">{$vo.title}</a></td>
                                <td><span>{:get_action_type($vo['type'])}</span></td>
                                <td>{$vo.remark}</td>
                                <td>{$vo.status_text}</td>
                                <td><a href="{:U('User/editAction?id='.$vo['id'])}">编辑</a>
                                    <a href="{:U('User/setStatus?Model=action&ids='.$vo['id'].'&status='.abs(1-$vo['status']))}" class="ajax-get">{$vo.status|show_status_op}</a>
                                    <a href="{:U('User/setStatus?Model=action&status=-1&ids='.$vo['id'])}" class="confirm ajax-get">删除</a>
                                    </td>
                            </tr>
                            </volist>
                        </tbody>
                    </table>
    
                    <!-- 分页 -->
                    <div class="page">{$_page}</div>
                    <!-- /分页 -->
                    
                </div>
            </div>
            <!-- END EXAMPLE TABLE PORTLET-->
        </div>
    </div>

</block>

<block name="script">
	<!-- BEGIN PAGE LEVEL PLUGINS -->
	<script type="text/javascript" src="__STATIC__/plugins/data-tables/jquery.dataTables.js"></script>
	<script type="text/javascript" src="__STATIC__/plugins/data-tables/DT_bootstrap.js"></script>
	<!-- END PAGE LEVEL PLUGINS -->
	<!-- BEGIN PAGE LEVEL SCRIPTS -->
	<script src="__STATIC__/scripts/app.js"></script>
	<script src="__STATIC__/scripts/table-managed.js"></script>     
	<script>
		jQuery(document).ready(function() {       
			App.init();
			TableManaged.init();
		});
	</script>
    <script>
	
    </script>
</block>
